const user = {
  namespaced: true,
  state: {
    userId: 0, // 用户id
    userMobile: '', // 用户登录的手机号码
    LoginState: false, // 用户登录状态
    token: '',
    isAutoLogin: false
  },
  getters: {

  },
  mutations: {
    LOGINSUCCESS(state, payload) {
      state.userId = payload.id
      state.userMobile = payload.user
      state.LoginState = true
    },
    APP_INIT(state, token) {
      state.state = token
    },
    AUTO_LOGIN(state, payload) {
      state.isAutoLogin = payload
      // 进行本地存储 手机号码
      localStorage.setItem('autoLogin', state.userMobile)
    }
  },
  actions: {

  }
}

export default user